<template>
    <div class="box">
        <div class="yuan" @click="change" :class="css ? 'active' :''">
            <i  class="iconfont icon-zhankai icon"></i>
            <i  class="iconfont icon-cheng font"></i>
        </div>
        <div class="Rotating" >
           <div class="content">
            <h1>{{ rotatingObj.title }}</h1>
            <span>{{ rotatingObj.author }}</span>
            <p>{{ rotatingObj.context }}</p>
            <h3>{{ rotatingObj.name }}</h3>
            <img :src="rotatingObj.img" />
            <p>{{ rotatingObj.context1 }}</p>
           </div>
        </div>
        <ul>
             <li v-for="(item,index) in rotatingObj.icon" :key="index"><i class="iconfont  icons" :class="item.icon"></i>{{ item.name }}</li>
            </ul>
    </div>
</template>

<script setup>
import { ref,reactive } from 'vue';
import {rotatingDate} from '@/config/index'
const css = ref(false)
const rotatingObj = reactive(rotatingDate)
const body = document.documentElement;
body.style.backgroundColor = '#000'
const change = () =>{
    css.value = !css.value
}
</script>

<style scoped>
.yuan {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #ff7979;
    left: -100px;
    top: -100px;
    z-index: 999999;
}
.active{
    transform: rotate(-70deg);
}
.active+.Rotating{
    transform: translateX(0);
    transition-delay: 0.3s;
    transform: rotate(-20deg);
}
.icon,.font{
    position: relative;
    color: #fff;
    font-size: 25px;
    font-weight: bolder;
}
.icon{
    top:135px;
    left:120px;
}
.font{
    top: 140px;
    left: 30px;
}
.Rotating {
    padding: 50px;
    background-color: #fff;
    transition: transform 0.5s linear;
    transform-origin: top left;
 
}
.content{
    padding: 0 300px;
}
img {
    max-width: 100%;
}

span {
    font-style: italic;
    color: #555;
    font-size: 14px;
}

p {
    color: #333;
}
.icons{
    color:#fff ;
    font-size: 25px;
    margin-right: 20px;
}
li{
    color: #fff;
    list-style: none;
    margin-bottom: 25px;
}
ul{
    position: fixed;
    bottom:40px;
    left: 0;
}
ul li:nth-child(2){
   margin-left: 10px;
}
ul li:nth-child(3){
   margin-left: 30px;
}
</style>